package com.ccxyz.ddd.application;
import com.ccxyz.ddd.model.response.UserInfoResponse;
import com.ccxyz.ddd.model.UserInfoDo;
import com.ccxyz.ddd.repository.user.UserInfoRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Optional;

/**
 * <p>
 * 通过组件形式提供服务
 * </p>
 *
 * @author 暮雨清风
 * @date 2022/2/17 15:33
 * @since 1.0.0
 */
@Component
@Slf4j
public class UserInfoManager {

    @Autowired
    private UserInfoRepository userInfoRepository;

    public UserInfoResponse userInfo(String userId) {
        UserInfoDo userInfoDo = userInfoRepository.selectById(userId);
        Optional.ofNullable(userInfoDo).orElseThrow(() -> new RuntimeException("用户查询不存在！"));
        log.info("{}", "todo");
        return UserInfoResponse.builder().build();
    }

}
